package com.sinodata.ns.file;

import java.io.File;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;


public class FileBean {
    private List list;

    public FileBean() {
        this.list = new ArrayList();
    }

    public void setForm(String name, String value) {
        Map map = new HashMap();
        map.put("formName", (name != null) ? name : "");
        map.put("formValue", (value != null) ? value : "");
        map.put("formType", "form");

        this.list.add(map);
    }

    public void setFile(String fliePath) {
        if (fliePath != null) {
            File file = new File(fliePath);

            if (file.exists()) {
                Map map = new HashMap();
                map.put("formName", "nffile");
                map.put("formValue", fliePath);
                map.put("formType", "file");
                
                this.list.add(map);
            }
        }
    }

    public List getContent() {
        return this.list;
    }
}
